package com.qf.springboot.ssm.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.qf.springboot.ssm.mapper.UserInfoMapper;
import com.qf.springboot.ssm.pojo.SysUserInfo;
import com.qf.springboot.ssm.service.impl.SysUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Created by 马英超 on 2022/9/19 22:46
 * @author： 马英超
 * @version：v1.0
 * @description: .__
 * ___________________|__| ____    ____
 * /  ___/\____ \_  __ \  |/    \  / ___\
 * \___ \ |  |_> >  | \/  |   |  \/ /_/  >
 * /____  >|   __/|__|  |__|___|  /\___  /
 * \/ |__|                 \//_____/
 */
@RestController
public class TestController {

/*  private SysUserServiceImpl service;

    @Autowired
    public void setService(SysUserServiceImpl service) {
        this.service = service;
    }*/

    private UserInfoMapper userInfoMapper;

    @Autowired
    public void setUserInfoMapper(UserInfoMapper userInfoMapper) {
        this.userInfoMapper = userInfoMapper;
    }

    @GetMapping("/findAll/{pageNum}/{pageSize}")
    public PageInfo<SysUserInfo> findByPage(@PathVariable int pageNum, @PathVariable int pageSize){
          PageHelper.startPage(pageNum,pageSize);
         // List<SysUserInfo> byAll = service.findByAll();
          List<SysUserInfo> byAll = userInfoMapper.findByAll();
          return  new PageInfo<>(byAll);
    }
}
